import Vue from 'vue'

// tabbark栏位置
Vue.directive('mytabbar', {
  inserted (el) {
    document.onscroll = function () {
      if (document.documentElement.scrollTop > 20) {
        el.style.top = '-44px'
      } else {
        el.style.top = '0px'
      }
    }
  },
  unbind () {
    document.onscroll = null
  }
})
